package com.muyu.payment.domain.resp;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.common.core.annotation.Excel;
import io.swagger.v3.oas.annotations.media.Schema;
import com.muyu.payment.domain.PaymentConfigs;
import com.muyu.payment.domain.model.PaymentConfigsPageQueryModel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 支付配置分页接口返回结果集
 *
 * @author muyu
 * @date 2025-09-17
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "支付配置分页接口返回结果集")
public class PaymentConfigsPageResp {
    /**
     * 主键ID
     */
    @Schema(name = "paymentId", title = "主键ID", description = "主键ID" , required = true)
    private Long paymentId;
    /**
     * 支付类型(1:微信 2:支付宝 3:其他)
     */
    @Schema(name = "payType", title = "支付类型(1:微信 2:支付宝 3:其他)", description = "支付类型(1:微信 2:支付宝 3:其他)" , required = true)
    private Long payType;

    /**
     * 应用ID
     */
    @Schema(name = "appId", title = "应用ID", description = "应用ID" , required = true)
    private String appId;

    /**
     * 商户号
     */
    @Schema(name = "merchantId", title = "商户号", description = "商户号" , required = true)
    private String merchantId;

    /**
     * 商户私钥
     */
    @Schema(name = "privateKey", title = "商户私钥", description = "商户私钥" , required = true)
    private String privateKey;

    /**
     * 平台公钥
     */
    @Schema(name = "publicKey", title = "平台公钥", description = "平台公钥" )
    private String publicKey;

    /**
     * 支付结果回调地址
     */
    @Schema(name = "callbackUrl", title = "支付结果回调地址", description = "支付结果回调地址" , required = true)
    private String callbackUrl;

    /**
     * 配置名称
     */
    @Schema(name = "configName", title = "配置名称", description = "配置名称" , required = true)
    private String configName;

    /**
     * 是否沙箱环境(0:正式环境 1:沙箱环境)
     */
    @Schema(name = "isSandbox", title = "是否沙箱环境(0:正式环境 1:沙箱环境)", description = "是否沙箱环境(0:正式环境 1:沙箱环境)" , required = true)
    private String isSandbox;

    /**
     * 状态(0:禁用 1:启用)
     */
    @Schema(name = "status", title = "状态(0:禁用 1:启用)", description = "状态(0:禁用 1:启用)" , required = true)
    private String status;
    /**
     * 创建人
     */
    @Schema(name = "createBy", title = "创建人", description = "创建人" )
    private String createBy;

    /**
     * 创建时间
     */
    @Schema(name = "createTime", title = "创建时间", description = "创建时间" )
    private Date createTime;

    /**
     * 修改人
     */
    @Schema(name = "updateBy", title = "修改人", description = "修改人" )
    private String updateBy;

    /**
     * 修改时间
     */
    @Schema(name = "updateTime", title = "修改时间", description = "修改时间" )
    private Date updateTime;
    /**
     * 备注
     */
    @Schema(name = "remark", title = "备注", description = "备注" )
    private String remark;
    /**
     * 信息构造器
     */
    public static PaymentConfigsPageResp infoBuild(PaymentConfigsPageQueryModel pageQueryModel){
        return PaymentConfigsPageResp.builder()
            .paymentId(pageQueryModel.getPaymentId())
            .payType(pageQueryModel.getPayType())
            .appId(pageQueryModel.getAppId())
            .merchantId(pageQueryModel.getMerchantId())
            .privateKey(pageQueryModel.getPrivateKey())
            .publicKey(pageQueryModel.getPublicKey())
            .callbackUrl(pageQueryModel.getCallbackUrl())
            .configName(pageQueryModel.getConfigName())
            .isSandbox(pageQueryModel.getIsSandbox())
            .status(pageQueryModel.getStatus())
            .createBy(pageQueryModel.getCreateBy())
            .createTime(pageQueryModel.getCreateTime())
            .updateBy(pageQueryModel.getUpdateBy())
            .updateTime(pageQueryModel.getUpdateTime())
            .build();
    }

}
